<template>
  <div class="child">
    <slot text="hello from child"></slot>
    <hr>
    <div v-demo:msg.a="info"></div>
    <hr>
  </div>
</template>

<script type="text/javascript">
//import HelloWorld from '@/components/HelloWorld.vue'
import demoMixin from '@/mixin/demo'
export default {
  name: 'ComChild',
  components: {},
  mixins:[demoMixin],
  data() {
    return {
      info: '这里是自定义指令v-demo'
    }
  },
  beforeCreate() {
    console.log('childBeforeCreate')
  },
  created() {
    console.log('childCreated')
    this.getName()
  },
  beforeMount() {
    console.log('childBeforeMount')
  },
  mounted() {
    console.log('childMounted')
  },
  methods: {
    getName() {
      console.log('组件内部的getName')
    }
  }
}
</script>

<style lang="scss" scoped></style>